<?php

FLEA::loadClass('FLEA_Com_RBAC_RolesManager');

class Table_Roles extends FLEA_Com_RBAC_RolesManager
{
	var $primaryKey = 'role_id';
	
	/*
	 * 创建roles表与Permissions表的多对多关联
	 * 即一个角色可以包含多个权限，同时一个权限也可以属于多个角色
	 * 中间表为roles_has_permissions
	 * 
	 * @var array
	 */
    var $manyToMany = array(
    	// 与权限表多对多关联
    	array(
	        'tableClass'  => 'Table_Permissions',
	        'mappingName' => 'permissions',
	        'joinTableClass'   => 'Table_RolesHasPermissions',
    	),
    );
    
	function Table_Roles($params = null){
		$this->tableName = FLEA::getAppInf('WebsetupTablePrefix').'roles';  
		parent::FLEA_Com_RBAC_RolesManager($params);  
	}
	
}

?>